/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #F8FAFC;
    color: #1E293B;
    line-height: 1.6;
}

/* 布局容器 */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.admin-sidebar {
    width: 240px;
    background-color: #1E293B;
    color: white;
    padding: 1.5rem 0;
    flex-shrink: 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}

.sidebar-logo i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    color: #38BDF8;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #CBD5E1;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background-color: #334155;
    color: white;
}

.nav-link i {
    width: 1.25rem;
    margin-right: 0.75rem;
}

/* 内容区 */
.admin-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E2E8F0;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1E293B;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3B82F6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563EB;
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.2);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #94A3B8;
    color: #64748B;
}

.btn-outline:hover {
    background-color: #F1F5F9;
}

.btn-danger {
    background-color: #EF4444;
    color: white;
}

.btn-danger:hover {
    background-color: #DC2626;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* 提示信息 */
.message {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.message-success {
    background-color: #ECFDF5;
    color: #059669;
    border: 1px solid #D1FAE5;
}

.message-error {
    background-color: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FEE2E2;
}

.message i {
    margin-right: 0.5rem;
}

/* 表单样式 */
.form-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-row > .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #64748B;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #CBD5E1;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

textarea.form-control {
    min-height: 200px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* 单选对钩样式 */
.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-item {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-item input {
    display: none;
}

.radio-custom {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #94A3B8;
    border-radius: 50%;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.2s;
}

.radio-item input:checked + .radio-custom {
    border-color: #3B82F6;
    background-color: #3B82F6;
}

.radio-item input:checked + .radio-custom::after {
    content: '';
    position: absolute;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-item span {
    color: #334155;
}

/* 步骤表单样式 */
.steps-container {
    margin-bottom: 1.5rem;
}

.step-item {
    background: #F8FAFC;
    padding: 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    position: relative;
    border: 1px solid #E2E8F0;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.step-title {
    font-weight: 600;
    color: #334155;
}

.remove-step {
    color: #EF4444;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.7;
}

.remove-step:hover {
    opacity: 1;
}

.add-step-btn {
    display: inline-flex;
    align-items: center;
    color: #3B82F6;
    background: none;
    border: 1px dashed #94A3B8;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.2s;
}

.add-step-btn i {
    margin-right: 0.5rem;
}

.add-step-btn:hover {
    border-color: #3B82F6;
    background-color: rgba(59, 130, 246, 0.05);
}

/* Markdown编辑器 */
.markdown-editor {
    border: 1px solid #CBD5E1;
    border-radius: 0.375rem;
    transition: border-color 0.2s;
}

.markdown-editor:focus-within {
    border-color: #3B82F6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* 上传弹窗 */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.modal-backdrop.show .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    font-size: 1.25rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #E2E8F0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* 导入提示 */
.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 0.5rem;
}

.tooltip-icon {
    color: #64748B;
    cursor: pointer;
}

.tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: #1E293B;
    color: white;
    text-align: left;
    border-radius: 0.375rem;
    padding: 0.75rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 前台样式 */
.front-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.article-list {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

.article-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.article-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.article-meta {
    color: #64748B;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
}

.article-excerpt {
    color: #475569;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-detail {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-top: 2rem;
}

.article-detail .article-title {
    font-size: 1.875rem;
    margin-bottom: 1rem;
}

.article-content {
    margin-top: 2rem;
    color: #334155;
}

.article-content h2, .article-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #1E293B;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content ul, .article-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.article-content img {
    max-width: 100%;
    border-radius: 0.375rem;
    margin: 1rem 0;
}

/* 响应式 */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 1rem;
    }
}